<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    :fullscreen="true"
    @ok="handleOk"
    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <tsl-wm-barcode-list-form
      ref="realForm"
      :barcode="barcode"
      :materialId="materialId"
      :code="code"
      :procurementDetailId="procurementDetailId"
      :arrivalNum="arrivalNum"
      :batch="batch"
      @ok="submitCallback"
      :disabled="disableSubmit"
    ></tsl-wm-barcode-list-form>
  </j-modal>
</template>

<script>
import TslWmBarcodeListForm from './TslWmBarcodeList'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'TslWmBarcodeListModal',
  components: {
    TslWmBarcodeListForm,
  },
  data() {
    return {
      title: '',
      width: 800,
      visible: false,
      disableSubmit: false,
      barcode: '',
      code: '',
      batch: '',
      materialCode: '',
      materialId: '',
      procurementDetailId: '',
      arrivalNum:'',
    }
  },
  methods: {
    add() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add()
      })
    },
    edit(record) {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record)
      })
    },
    close() {
      this.$emit('close')
      this.visible = false
    },
    handleOk() {
      this.$refs.realForm.submitForm()
    },
    submitCallback() {
      this.$emit('ok')
      this.visible = false
    },
    handleCancel() {
      this.close()
    },
    putBarcode() {
      this.visible = true
      console.log('传入barcode1' + this.barcode)
      console.log('传入code' + this.code)

      console.log('传入materialId' + this.materialId)
      console.log('传入batch' + this.batch)
      console.log('arrival' + this.arrivalNum)
      this.$nextTick(() => {})
    },
    loadData(arg) {
      console.log('传入barcode' + this.barcode)
    },
  },
}
</script>